<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>JavaScript unit test file</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <script src="../lib/prototype.js" type="text/javascript"></script>
  <script src="../lib/unittest.js" type="text/javascript"></script>
  <script src="../src/should_receive.js" type="text/javascript"></script>
  
  <script src="../src/behavior.js" type="text/javascript"></script>
  <script src="../src/notification.js" type="text/javascript"></script>
  <script src="../src/forms.js" type="text/javascript"></script>
  <link rel="stylesheet" href="../lib/unittest.css" type="text/css" />
</head>
<body>
<div id="testlog"></div>
<script type="text/javascript">
// <![CDATA[
  Ajax = {
    "::submit": function(ev) {
      ev.stop()
      console.log(arguments)
    }
  }
  Behavior.add({
    "form":[Validate.onSubmit, Ajax],
    "form::app:error-direct": showError,
    "#name":Validate.NotEmpty(),
    ".email":Validate.Email(),
    ".tags":[IdentifyTokens(/w/)]
  })
  document.observe("dom:loaded", function() { Event.updateObserversFor(document.body) })
  Test.context("The Behavior library", {
    setup: function() {

    },
    teardown: function() {
      // Event.stopObservingAllSelectors()
    }
    
  })
// ]]>
</script>
<form action="validation_test.html" method="get" accept-charset="utf-8">
  <label for="name">Name:</label>
  <input type="text" name="name" value="" id="name"><br />
  <label for="email">Email:</label>
  <input type="text" name="email" value="" id="email" class="email"><br />
  <label for="tags">Tags:</label>
  <input type="text" name="tags" value="" id="tags" class="tags"><br />
  <ul class="errors">
  </ul>
  <p><input type="submit" value="Continue &rarr;"></p>
</form>
</script>
</body>
</html>